<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>供应商投标</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/lib/layui/layui/css/layui.css"/>
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery/jquery.cookie.js"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/js/common/fileupload.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
</head>
<style>
    * {font-family: "Microsoft Yahei" !important;}
    .header{
        margin-top: 15px;
        height: 35px;
        margin: 20px;
    }
    .header .title{
        margin-left: 22px;
    }
    .header span{
        float: none;
        font-size: 22px;
        color: #333;
        display: inline-block;
        margin-left: 10px;
        vertical-align: middle;
        margin-top: -6px;
    }
    .openFile input[type=file]{
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 18px;
        z-index: 99;
        opacity: 0;
    }
</style>
<body>
<div>
    <div class="header">
        <div class="title">
            <img src="/img/commonTheme/${sessionScope.InterfaceModel}/flow_run_title.png"><span style="">供应商投标</span>
            <hr style="background-color: black"/>
        </div>
    </div>
    <div style="margin: auto 24px">
        <table class="layui-hide" id="test" lay-filter="test"></table>
    </div>
</div>
</body>
</html>
<script type="text/html" id="barDemo">
    {{#  if( ( d.status == 2 && d.crmTenderInfo == undefined )||( d.status == 2 && d.crmTenderInfo != undefined && d.crmTenderInfo.tenderStatus == '1'  ) ){ }}
    <a class="layui-btn layui-btn-xs" lay-event="detail">投标</a>
    {{#  } }}

    {{#  if( d.status == 2 && d.crmTenderInfo != undefined && d.crmTenderInfo.tenderStatus == '1'   ){ }}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="edit">投标完成</a>
    {{#  } }}

    {{#  if(d.status == 4 || (d.status == 2 && d.crmTenderInfo != undefined && d.crmTenderInfo.tenderStatus == '3') ){ }}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="look">查看</a>
    {{#  } }}

</script>

<script>

    $(function(){
        layui.use(['form', 'layedit', 'laydate','table'], function(){
            var form = layui.form
                ,table =layui.table
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate;

            var tableInt = table.render({
                elem: '#test'
                ,url: '/biddingInfo/getBiddingInfo'
                ,where:{
                    tenderUserName:"admin"
                }
                ,cols: [[
                    {field:'projectNo', title:'项目编号'}
                    ,{field:'projectName', title:'项目名称'}
                    ,{field:'releaseDate', title:'发布日期'}
                    ,{field:'biddingBeginDate', title:'投标开始日期'}
                    ,{field:'biddingEndDate', title:'投标结束日期'}
                    ,{field:'attachmentName', title:'招标文件'}
                    ,{field:'status', title:'状态',templet: function (d) {
                            var status = d.status
                            if(status == 1){
                                return '未发布'
                            }else if(status == 2){
                                return '已发布'
                            }else if(status == 3){
                                return '开标中'
                            }else {
                                return '结束'
                            }
                    }}
                    ,{title:'中标状态',templet: function (d) {
                            var crmTenderInfo = d.crmTenderInfo
                            if( crmTenderInfo != undefined && crmTenderInfo.hitStatus == '1'){
                                return '已中标';
                            }else if(crmTenderInfo != undefined && crmTenderInfo.hitStatus == '2'){
                                return '未中标';
                            }else if(crmTenderInfo != undefined && crmTenderInfo.hitStatus == '0'){
                                return '待定';
                            }
                            return '';
                    }}
                    ,{title:'操作', toolbar: '#barDemo',align:'center'}
                ]]
                ,page: true
                ,parseData: function(res){
                    return {
                        "code": 0,
                        "msg": res.msg,
                        "count": res.totleNum,
                        "data": res.obj
                    };
                }
            });


            //监听工具行事件
            table.on('tool(test)', function(obj){
                var data = obj.data;
                var layEvent = obj.event;
                var tr = obj.tr;
                //投标
                if(layEvent === 'detail'){

                    layer.open({
                        type: 1,
                        title: '发布',
                        btn: ['确定','返回'],
                        shade: 0.5,
                        area: ['40%', '70%'],
                        content: '<div id="cont" style="margin: 10px">\n' +
                            '        <form class="layui-form" action="" id="ajaxforms" lay-filter="ajaxforms">\n' +
                            '            <div class="layui-form-item" style="margin-top: 15px">\n' +
                            '                <div class="layui-inline">\n' +
                            '                   <label class="layui-form-label">项目编号：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="projectNo" lay-verify="required|phone" autocomplete="off"\n' +
                            '                               class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-form-item" style="margin-top: 15px">\n' +
                            '                <div class="layui-inline">\n' +
                            '                   <label class="layui-form-label">项目名称：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="projectName" lay-verify="required|phone" autocomplete="off"\n' +
                            '                               class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-form-item" style="margin-top: 15px">\n' +
                            '                <div class="layui-inline">\n' +
                            '                  <label class="layui-form-label">项目年度：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="projectYear" lay-verify="required|phone" autocomplete="off"\n' +
                            '                               class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-form-item">\n' +
                            '               <div class="layui-inline">\n' +
                            '                    <label class="layui-form-label">投标人：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <textarea  type="text" id="rescueUser"  user_id=""  class="layui-textarea" disabled>\n' +
                            '                    </textarea></div>\n' +
                            // '                    <a href="javascript:;" style="color:#1E9FFF" class="adduser">添加</a>\n' +
                            // '                    <a href="javascript:;" style="color:red" class="clearuser">清空</a>\n' +
                            '                </div>\n'+
                            '            </div>\n' +
                            '            <div class="layui-form-item">\n' +
                            '                <div class="layui-inline">\n' +
                            '                    <label class="layui-form-label">采购部门：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" id="deptNames" lay-verify="url" autocomplete="off" class="layui-input" disabled>\n' +
                            '                    </div>\n' +
                            // '                    <a href="javascript:;" style="color:#1E9FFF" class="addExecute">添加</a>\n' +
                            // '                    <a href="javascript:;" style="color:red" class="clearExecute">清空</a>\n' +
                            '                </div>\n'+
                            '            </div>\n' +
                            '            <div class="layui-form-item" style="margin-top: 15px">\n' +
                            '                <div class="layui-inline">\n' +
                            '                   <label class="layui-form-label">详细要求：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="infoDesc" lay-verify="required|phone" autocomplete="off"\n' +
                            '                               class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-form-item">\n' +
                            '                <div class="layui-inline">\n' +
                            '                    <label class="layui-form-label">发布日期：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="releaseDate" id="date" lay-verify="date"\n' +
                            '                               autocomplete="off" class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-form-item">\n' +
                            '                <div class="layui-inline">\n' +
                            '                  <label class="layui-form-label">投标开始日期：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="biddingBeginDate" id="dateStart" lay-verify="date"\n' +
                            '                               autocomplete="off" class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            '            <div class="layui-form-item">\n' +
                            '                <div class="layui-inline">\n' +
                            '                    <label class="layui-form-label">投标结束日期：</label>\n' +
                            '                    <div class="layui-input-inline">\n' +
                            '                        <input type="text" name="biddingEndDate" id="dateEnd" lay-verify="date"\n' +
                            '                               autocomplete="off" class="layui-input required layui-disabled"  disabled>\n' +
                            '                    </div>\n' +
                            '                </div>\n' +
                            '            </div>\n' +
                            ' <div class="layui-form-item"  style="margin-top:15px">\n' +
                            '    <label class="layui-form-label">招标文件：</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '<div id="fujians"></div>' +
                            ' <div id="fileAll">\n' +
                            '</div>\n' +
                            '<a href="javascript:;" class="openFile" style="float: left;margin-top:8px;position:relative">\n' +
                            '<img src="../img/mg11.png" alt="">\n' +
                            '<span>添加附件</span>\n' +
                            '<input type="file" multiple id="fileupload" data-url="/upload?module=certification" name="file">\n' +
                            '</a>\n' +
                            '</div>\n' +
                            '</div>' +
                            ' <div class="layui-form-item"  style="margin-top:15px">\n' +
                            '    <label class="layui-form-label">投标文件：</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '<div id="fujians2"></div>' +
                            ' <div id="fileAll2">\n' +
                            '</div>\n' +
                            '<a href="javascript:;" class="openFile" style="float: left;margin-top:8px;position:relative">\n' +
                            '<img src="../img/mg11.png" alt="">\n' +
                            '<span>添加附件</span>\n' +
                            '<input type="file" multiple id="fileupload2" data-url="/upload?module=certification" name="file">\n' +
                            '</a>\n' +
                            '</div>\n' +
                            '</div>' +
                            '        </form>\n' +
                            '    </div>',
                        success:function (res) {
                            //日期
                            laydate.render({
                                elem: '#year'
                                ,trigger: 'click'//呼出事件改成click
                                ,type:'year'
                            });
                            laydate.render({
                                elem: '#date'
                                , trigger: 'click'//呼出事件改成click
                            });
                            laydate.render({
                                elem: '#dateStart'
                                , trigger: 'click'//呼出事件改成click
                            });
                            laydate.render({
                                elem: '#dateEnd'
                                , trigger: 'click'//呼出事件改成click
                            });
                            form.render();

                            //采购部门点击添加的按钮
                            $(".addExecute").on("click",function(){
                                dept_id = "deptNames";
                                $.popWindow("/common/selectDept?0");
                            });

                            $('.clearExecute').click(function () {
                                $('#deptNames').attr("deptid", "");
                                $('#deptNames').attr("deptno", "");
                                $('#deptNames').attr("deptname", "");
                                $('#deptNames').val("");
                            });

                            //进货人点击添加的按钮
                            $(".adduser").on("click",function(){
                                user_id = "rescueUser";
                                $.popWindow("/common/selectUser");
                            });

                            $('.clearuser').click(function () {
                                $("#rescueUser").val("");
                                $("#rescueUser").attr('username','');
                                $("#rescueUser").attr('dataid','');
                                $("#rescueUser").attr('user_id','');
                                $("#rescueUser").attr('userprivname','');
                            });
                            fileuploadFn('#fileupload', $('#fileAll'));
                            fileuploadFn('#fileupload2', $('#fileAll2'));
                            //回显招标信息
                            var biddingId= data.biddingId
                            $.ajax({
                                url:'/biddingInfo/getBiddingInfo',
                                dataType: 'json',
                                type: 'get',
                                data:{
                                    biddingId:biddingId,
                                },
                                success:function (res) {
                                    var str = ''
                                    form.render()
                                    if(res.obj.length>0){
                                        var  attachmentList = res.obj[0].attachmentList
                                        if(attachmentList !=undefined && attachmentList.length>0){
                                            for(var i=0;i<res.obj[0].attachmentList.length;i++){
                                                str+='<div class="dech" deUrl="' +res.obj[0].attachmentList[i].attUrl + '"><a href="/download?' + res.obj[0].attachmentList[i].attUrl + '" NAME="' + res.obj[0].attachmentList[i].attachName +'*"><img style="margin-right:10px;" src="/img/attachment_icon.png"/>' + res.obj[0].attachmentList[i].attachName + '</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="/img/file/icon_deletecha_03.png"/><input type="hidden" class="inHidden" value="' + res.obj[0].attachmentList[i].aid + '@' + res.obj[0].attachmentList[i].ym + '_' + res.obj[0].attachmentList[i].attachId +',"></div>'
                                            }
                                        }else{
                                            str='';
                                        }
                                        $('#fujians').html(str)
                                        $('#rescueUser').val(res.obj[0].tenderUserName)
                                        $("#rescueUser").attr('user_id',res.obj[0].tenderUserid);

                                        $('#deptNames').val(res.obj[0].purchaseDeptName)
                                        $("#deptNames").attr('deptid',res.obj[0].purchaseDeptid);
                                        form.val("ajaxforms", res.obj[0]);
                                    }

                                }

                            })

                        //    回显投标附件
                            $.ajax({
                                url:'/TenderInfo/getTenderInfo',
                                dataType: 'json',
                                type: 'get',
                                data:{
                                    biddingId:biddingId,
                                    userId:'admin'
                                },
                                success:function (res) {
                                    var str = ''
                                    form.render()
                                    if(res.obj.length>0){
                                        var  attachmentList = res.obj[0].attachmentList
                                        if(attachmentList !=undefined && attachmentList.length>0){
                                            for(var i=0;i<attachmentList.length;i++){
                                                str+='<div class="dech" deUrl="' +attachmentList[i].attUrl + '"><a href="/download?' + attachmentList[i].attUrl + '" NAME="' + attachmentList[i].attachName +'*"><img style="margin-right:10px;" src="/img/attachment_icon.png"/>' + attachmentList[i].attachName + '</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="/img/file/icon_deletecha_03.png"/><input type="hidden" class="inHidden" value="' + attachmentList[i].aid + '@' + attachmentList[i].ym + '_' + attachmentList[i].attachId +',"></div>'
                                            }
                                        }else{
                                            str='';
                                        }
                                        $('#fujians2').html(str)
                                    }

                                }

                            })
                        },
                        yes:function (index) {
                            //附件
                            var attachmentId = '';
                            var attachmentName = '';
                            for (var i = 0; i < $('#fileAll2 .dech').length; i++) {
                                attachmentId += $('#fileAll2 .dech').eq(i).find('input').val();
                                attachmentName += $('#fileAll2 a').eq(i).attr('name');
                            }
                            for (var i = 0; i < $('#fujians2 .dech').length; i++) {
                                attachmentId += $('#fujians2 .dech').eq(i).find('input').val();
                                attachmentName += $('#fujians2 a').eq(i).attr('name');
                            }
                            var tenderId = ''
                            if(data.crmTenderInfo != undefined){
                                tenderId = data.crmTenderInfo.tenderId
                            }
                            $.ajax({
                                url: '/TenderInfo/editTenderInfo',
                                dataType: 'json',
                                type: 'get',
                                data:{
                                    attachmentId:attachmentId,
                                    attachmentName:attachmentName,
                                    biddingId:data.biddingId,
                                    tenderStatus:1,
                                    hitStatus:0,
                                    tenderId:tenderId
                                },
                                success: function (res) {
                                    if(res.flag == true){
                                        layer.alert('投标成功！', {icon: 1})
                                        window.location.reload()
                                    }else {
                                        layer.alert('请上传投标文件', {icon: 2})
                                    }
                                }

                            })


                            tableInt.reload()
                            layer.closeAll();
                        }
                    })



                }else if(layEvent === 'edit'){ ////投标完成
                    $.ajax({
                        url: '/TenderInfo/editTenderInfo',
                        dataType: 'json',
                        type: 'get',
                        data:{
                            tenderId:data.crmTenderInfo.tenderId,
                            tenderStatus:3,
                            tenderEnd:'tenderEnd'
                        },
                        success: function (res) {
                            console.log(res.turn)
                            if(res.flag == true){
                                layer.alert('投标完成！', {icon: 1})
                                window.location.reload()
                            }else {
                                layer.alert(res.msg, {icon: 2})
                            }
                        }
                    })

                }else if(layEvent === 'look'){

                    layer.open({
                        type: 1,
                        title: '查看详情',
                        btn: ['返回'],
                        shade: 0.5,
                        maxmin: true, //开启最大化最小化按钮
                        area: ['30%', '70%'],
                        content:'<form class="layui-form" action=""  lay-filter="ajaxforms2">\n' +
                            '  <div class="layui-form-item">\n' +
                            '    <label class="layui-form-label">项目编号</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '      <input type="text" name="projectNo" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                            '    </div>\n' +
                            '  </div>\n' +
                            '  <div class="layui-form-item">\n' +
                            '    <label class="layui-form-label">项目名称</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '      <input type="text" name="projectName" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                            '    </div>\n' +
                            '  </div>\n' +
                            '  <div class="layui-form-item">\n' +
                            '    <label class="layui-form-label">供应商</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '      <input type="text" name="tenderUserName" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                            '    </div>\n' +
                            '  </div>\n' +
                            '  <div class="layui-form-item">\n' +
                            '    <label class="layui-form-label">投标状态</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '      <input type="text" name="tenderStatus" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                            '    </div>\n' +
                            '  </div>\n' +
                            '  <div class="layui-form-item">\n' +
                            '    <label class="layui-form-label">完成投标日期</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '      <input type="text" name="biddingEndDate" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                            '    </div>\n' +
                            '  </div>\n' +
                            '  <div class="layui-form-item">\n' +
                            '    <label class="layui-form-label">中标状态</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '      <input type="text" name="hitStatus" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">\n' +
                            '    </div>\n' +
                            '  </div>\n' +
                            ' <div class="layui-form-item"  style="margin-top:15px">\n' +
                            '    <label class="layui-form-label">投标文件：</label>\n' +
                            '    <div class="layui-input-inline">\n' +
                            '<div id="fujians2"></div>' +
                            ' <div id="fileAll2">\n' +
                            '</div>\n' +
                            '<a href="javascript:;" class="openFile" style="float: left;margin-top:8px;position:relative">\n' +
                            '<img src="../img/mg11.png" alt="">\n' +
                            '<span>添加附件</span>\n' +
                            '<input type="file" multiple id="fileupload2" data-url="/upload?module=certification" name="file">\n' +
                            '</a>\n' +
                            '</div>\n' +
                            '</div>' +
                            '</form>',
                        success:function () {
                            $.ajax({

                                url:'/TenderInfo/getTenderInfo',
                                dataType: 'json',
                                type: 'get',
                                data:{
                                    biddingId:data.biddingId,
                                    userId:'admin'
                                },
                                success:function (res) {

                                    var str = ''
                                    form.render()
                                    if(res.obj.length>0){
                                        var  attachmentList = res.obj[0].attachmentList
                                        if(attachmentList !=undefined && attachmentList.length>0){
                                            for(var i=0;i<attachmentList.length;i++){
                                                str+='<div class="dech" deUrl="' +attachmentList[i].attUrl + '"><a href="/download?' + attachmentList[i].attUrl + '" NAME="' + attachmentList[i].attachName +'*"><img style="margin-right:10px;" src="/img/attachment_icon.png"/>' + attachmentList[i].attachName + '</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="/img/file/icon_deletecha_03.png"/><input type="hidden" class="inHidden" value="' + attachmentList[i].aid + '@' + attachmentList[i].ym + '_' + attachmentList[i].attachId +',"></div>'
                                            }
                                        }else{
                                            str='';
                                        }
                                        $('#fujians2').html(str)
                                    }
                                    form.val("ajaxforms2", res.obj[0].crmBiddingInfo);
                                    //投标状态
                                    var tenderStatus = res.obj[0].tenderStatus
                                    var tenderStatusTe = ''
                                    if(tenderStatus == 0){
                                        tenderStatusTe = '未查看'
                                    }else if(tenderStatus == 1){
                                        tenderStatusTe = '未完成'
                                    }else {
                                        tenderStatusTe = '完成'
                                    }
                                    //中标状态
                                    var hitStatus = res.obj[0].hitStatus
                                    if(hitStatus == '0'){
                                        hitStatusTe = '待定'
                                    }else if(hitStatus == '1'){
                                        hitStatusTe = '中标'
                                    }else {
                                        hitStatusTe = '未中标'
                                    }
                                    $('input[name="tenderStatus"]').val(tenderStatusTe)
                                    $('input[name="hitStatus"]').val(hitStatusTe)

                                    $('input').css('border','none')
                                    $('input').css('margin-top','6px')
                                    $('input').css('background','white')
                                    $('input').attr('class','layui-disabled')
                                    $('input').attr('disabled',true)
                                }

                            })
                        }

                    })

                }
            });

            //删除附件
            $(document).on('click', '.deImgs', function () {
                var _this = this;
                var attUrl = $(this).parents('.dech').attr('deUrl');
                layer.confirm('确定删除该附件吗？', function (index) {
                    $.ajax({
                        type: 'get',
                        url: '/delete?' + attUrl,
                        dataType: 'json',
                        success: function (res) {
                            if (res.flag == true) {
                                layer.msg('删除成功', {icon: 6, time: 1000});
                                $(_this).parent().remove();
                            } else {
                                layer.msg('删除失败', {icon: 2, time: 1000});
                            }
                        }
                    })
                });
            });

        });
    });
</script>
